package pri.wallen.daemonThread;

public class Daemon {

    public static void main(String[] args) throws InterruptedException {
	    Thread thread = new Thread(new DaemonWorker(), "守护工作线程");
	    thread.setDaemon(true);
	    thread.start();
        thread.interrupt();
        Thread.sleep(0, 1);

    }

    // 静态 worker 类
    static class DaemonWorker implements Runnable {

        @Override
        public void run() {
            try {
                Thread.sleep(10*1000);
            } catch (InterruptedException e) {
                System.out.println("Daemon worker 被中断。。。");
            } finally {
                System.out.println("Daemon Worker 执行完成！！！");
            }
        }
    }
}
